<template>
	<view>
		<yingbing-video ref="video" autoplay muted :controls="controls" :barrage-show="barragesShow" title="测试视频" :src="src" @error="handleError" @fullscreenChange="handleFullscreenChange" />
		<button @tap="fullscreen">全屏播放</button>
	</view>
</template>

<script>
	export default {
		data () {
			return {
				// src: 'http://hls.full.maxbiz.com.cn/yehangchuan/8888.m3u8',
				// src: 'https://video.ondemandcn.com/98126187b7df4119996c1af834b934d6/d1f5cadf268f401c867746268d350081-10883b4fb481a0ae978efbf06ee4dbf6-ld.m3u8',
				// src: 'https://cntv.sbs/tv?auth=230918&id=cctv2',
				// src: 'https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-uni-app-doc/a876efc0-4f35-11eb-97b7-0dc4655d6e68.mp4',
				// src: 'https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8',
				// src: 'http://1011.hlsplay.aodianyun.com/demo/game.flv',
				// src: 'https://cn-jsyz-ct-03-46.bilivideo.com/live-bvc/418327/live_3546384728852917_42331970/index.m3u8?expires=1701163956&len=0&oi=0x240e0314a31ccc00b18f41a17ad40fd6&pt=web&qn=0&trid=10074c340fbd77864ba9b30ca5c8900f763c&sigparams=cdn,expires,len,oi,pt,qn,trid&cdn=cn-gotcha01&sign=c01ebba34d9f733d3c2341fc76863592&sk=2d69b2d1e3dd95c209dddb88bf8b4d54&flvsk=412cffc63fd3815de03296534b67dbe3&p2p_type=1&sl=1&free_type=0&mid=265129317&sid=cn-jsyz-ct-03-46&chash=1&sche=ban&bvchls=1&score=4&pp=rtmp&source=onetier&trace=1098&site=0d001affa80842deefc7bbaaebb2fb50&zoneid_l=151371777&sid_l=stream_name_cold&order=1',
				src: 'https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv',
				// src: 'http://111.10.223.112:7086/live/cameraid/1000149%243/substream/1.m3u8',
				// src: 'http://111.10.223.112:7086/live/cameraid/1000083%244/substream/1.m3u8',
				// src: 'https://img.cdn.aliyun.dcloud.net.cn/guide/uniapp/%E7%AC%AC1%E8%AE%B2%EF%BC%88uni-app%E4%BA%A7%E5%93%81%E4%BB%8B%E7%BB%8D%EF%BC%89-%20DCloud%E5%AE%98%E6%96%B9%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B@20181126-lite.m4v',
				// src: 'https://ydtnt-jw.oss-cn-zhangjiakou.aliyuncs.com/jw-video/%E8%A7%86%E9%A2%91/%E8%8B%B1%E8%AF%AD/%E5%94%90%E8%BF%9F%E8%AF%8D%E6%B1%87%E7%9A%84%E9%80%BB%E8%BE%91%E5%8D%95%E8%AF%8D%E8%AF%BE/Unit1-1_batch.mp4',
				flvConfig: {
					cors: true
				},
				barragesShow: true,
				controls: true
			}
		},
		methods: {
			fullscreen () {
				this.$refs.video.launchFullscreen()
			},
			handleError (e) {
				console.log('error', e);
			},
			handleFullscreenChange (e) {
				if ( e.fullscreen ) {
					this.controls = true
				} else {
					this.controls = false
				}
			}
		},
		onReady() {
			setTimeout(() => {
				this.barragesShow = false
			}, 100)
		}
	}
</script>

<style>
</style>